package com.eva.learn.concurrent.thinkInJava;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * shutdown()方法可以防止新任务被提交给这个Executor，已经提交的任务会被继续执行结束
 * 
 * @author Evain.C
 *
 */
public class SingleThreadExecutor {
	public static void main(String[] args) {
		ExecutorService exec = Executors.newSingleThreadExecutor();
		for (int i = 0; i < 5; i++) {
			exec.execute(new LiftOff());
		}
		exec.shutdown();
	}
}
